package cn.yy.pos.launcher.service;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

public class Operator implements Parcelable{
	
	private String operatorName;
	private String groupID;
	private String groupName;
	private String groupAddress;
	private String groupPhone;
	private String tenantsID;
	private String tenantsName;
//	private String tenantPhone;
	private String universalid;
	private String operatorAccount;
	private String posName;
	private String posCode;
	private String isInvoice;
	private String servicePhone;
	private String bankType;
	private String mis;
	private ArrayList<Payway> payways = new ArrayList<Payway>();

	/**
	 * 获取序列化对象 注意写出顺序
	 * @param in
	 */
	public Operator(Parcel in) {
		readFromParcel(in);
	}
	
	public Operator() {
		
	}

	public String getPosName() {
		return posName;
	}

	public void setPosName(String posName) {
		this.posName = posName;
	}

	public String getPosCode() {
		return posCode;
	}

	public void setPosCode(String posCode) {
		this.posCode = posCode;
	}
	
	public String getUniversalid() {
		return universalid;
	}
	
	public void setUniversalid(String universalid) {
		this.universalid = universalid;
	}
	
	public String getOperatorAccount() {
		return operatorAccount;
	}
	
	public void setOperatorAccount(String operatorAccount) {
		this.operatorAccount = operatorAccount;
	}
	
	public String getOperatorName() {
		return operatorName;
	}
	
	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}
	
	public String getGroupID() {
		return groupID;
	}
	
	public void setGroupID(String groupID) {
		this.groupID = groupID;
	}
	
	public String getTenantsID() {
		return tenantsID;
	}
	
	public void setTenantsID(String tenantsID) {
		this.tenantsID = tenantsID;
	}

	public String getGroupName() {
		return groupName;
	}
	
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	
	public String getGroupAddress() {
		return groupAddress;
	}
	
	public void setGroupAddress(String groupAddress) {
		this.groupAddress = groupAddress;
	}
	
	public String getGroupPhone() {
		return groupPhone;
	}
	
	public void setGroupPhone(String groupPhone) {
		this.groupPhone = groupPhone;
	}
	
	public String getTenantsName() {
		return tenantsName;
	}
	
	public void setTenantsName(String tenantsName) {
		this.tenantsName = tenantsName;
	}
	
	public static Parcelable.Creator<Operator> getCreator() {
		return CREATOR;
	}

	public String getMis() {
		return mis;
	}

	public void setMis(String mis) {
		this.mis = mis;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	//序列化时写入数据  注意写入顺序
	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeString(getOperatorName());
		out.writeString(getGroupID());
		out.writeString(getGroupName());
		out.writeString(getGroupAddress());
		out.writeString(getGroupPhone());
		out.writeString(getTenantsID());
		out.writeString(getTenantsName());
		out.writeString(getUniversalid());
		out.writeString(getOperatorAccount());
		out.writeString(getPosName());
		out.writeString(getPosCode());
		out.writeString(getIsInvoice());
		out.writeString(getServicePhone());
		out.writeString(getBankType());
		out.writeString(getMis());
		out.writeList(getPayways());
	}
	
	public void readFromParcel(Parcel in) {
		setOperatorName(in.readString());
		setGroupID(in.readString());
		setGroupName(in.readString());
		setGroupAddress(in.readString());
		setGroupPhone(in.readString());
		setTenantsID(in.readString());
		setTenantsName(in.readString());
		setUniversalid(in.readString());
		setOperatorAccount(in.readString());
		setPosName(in.readString());
		setPosCode(in.readString());
		setIsInvoice(in.readString());
		setServicePhone(in.readString());
		setBankType(in.readString());
		setMis(in.readString());
		in.readTypedList(payways, Payway.CREATOR);
	}
	
	 public static final Parcelable.Creator<Operator> CREATOR = new Creator<Operator>() {

		@Override
		public Operator createFromParcel(Parcel source) {
			return new Operator(source);
		}

		@Override
		public Operator[] newArray(int size) {
			return new Operator[size];
		}
	};


	public String getServicePhone() {
		return servicePhone;
	}

	public void setServicePhone(String servicePhone) {
		this.servicePhone = servicePhone;
	}

	public String getIsInvoice() {
		return isInvoice;
	}

	public void setIsInvoice(String isInvoice) {
		this.isInvoice = isInvoice;
	}

	public String getBankType() {
		return bankType;
	}

	public void setBankType(String bankType) {
		this.bankType = bankType;
	}

	public ArrayList<Payway> getPayways() {
		return payways;
	}

	public void setPayways(ArrayList<Payway> payways) {
		this.payways = payways;
	}
}
